package com.jsmtr.rms.controller.DUserResume;

import com.jsmtr.rms.entity.*;
import com.jsmtr.rms.service.*;
import com.jsmtr.rms.utils.EnumTools;
import com.jsmtr.rms.utils.StringTools;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;

/**
 * @author: cyx
 * @description:
 * @date: Created in 2019/3/4 16:47
 * @modified by:
 */
@Controller
public class DUserResumePublicController {

    @Resource
    private IUtilService utilService;

    @Resource
    private IDoMSService msService;

    @Resource
    private IDoBSService bsService;

    @Resource
    private IDoSZService szService;

    @Resource
    private IDoResumeService doResumeService;

    @Resource
    private IDoZZService doZZService;

    @Resource
    private IProjectService projectService;

    @RequestMapping(value = "/DUserResume/PublishResultAction", method = RequestMethod.POST)
    public void PublishResultAction(HttpServletRequest request, HttpServletResponse response) {
        try {
            String[] ids = request.getParameterValues("id");//人员信息ID
            if (ids != null) {
                String fid = request.getParameter("fid").trim();//招聘流程ID
                String deptcode = request.getParameter("deptcode").trim();//责任部门编码
                BaseUser usr = utilService.getSessionUser(request);
                if (usr.getUdept().equals(deptcode)) {
                    //流程是否结束
                    if (utilService.FlowIsDoing(fid)) {
                        List editlist = new ArrayList();
                        List<DUserResume> resumes = doResumeService.getResumes(ids);
                        ProjectInfoFlow nFlow = projectService.getFolwById(fid);
                        String flowName = nFlow.getFname();
                        if (!StringTools.trimNotEmpty(flowName)) {
                            flowName = nFlow.getNickname();
                        }
                        if (StringTools.trimNotEmpty(flowName)) {
                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.简历筛选.name())) {
                                for (DUserResume user : resumes) {
                                    if (user.getOp1() == null || user.getOp1().equals("未公布")) {
                                        user.setOp1("已公布");
                                    } else {
                                        user.setOp1("未公布");
                                    }
                                    editlist.add(user);
                                }
                            }
                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.面试.name())) {
                                List<DoMSUser> msUsers = msService.getMsUsers(ids, fid);
                                for (DoMSUser user : msUsers) {
                                    if (user.getOp7() == null || user.getOp7().equals("未公布")) {
                                        user.setOp7("已公布");
                                    } else {
                                        user.setOp7("未公布");
                                    }
                                    editlist.add(user);
                                }
                            }

                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.背景调查.name()) || flowName.equalsIgnoreCase("政审")) {
                                for (DUserResume user : resumes) {
                                    if (user.getOp3() == null || user.getOp3().equals("未公布")) {
                                        user.setOp3("已公布");
                                    } else {
                                        user.setOp3("未公布");
                                    }
                                    editlist.add(user);
                                }
                            }
                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.体检.name())) {
                                for (DUserResume user : resumes) {
                                    if (user.getOp4() == null || user.getOp4().equals("未公布")) {
                                        user.setOp4("已公布");
                                    } else {
                                        user.setOp4("未公布");
                                    }
                                    editlist.add(user);
                                }
                            }

                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.资料审核.name())) {
                                for (DUserResume user : resumes) {
                                    if (user.getOp2() == null || user.getOp2().equals("未公布")) {
                                        user.setOp2("已公布");

                                    } else {
                                        user.setOp2("未公布");
                                    }
                                    editlist.add(user);
                                }
                            }

                            if (nFlow.getFid() == EnumTools.FlowNomalState.实作.ordinal()) {
                                List<DoOperationUser> szUsers = szService.getSZUsers(fid, ids);
                                for (DoOperationUser user : szUsers) {
                                    if (user.getOp8() == null || user.getOp8().equals("未公布")) {
                                        user.setOp8("已公布");
                                    } else {
                                        user.setOp8("未公布");
                                    }
                                    editlist.add(user);
                                }
                            }

                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.实习.name())) {
                                for (DUserResume user : resumes) {
                                    if (user.getOp7() == null || user.getOp7().equals("未公布")) {
                                        user.setOp7("已公布");

                                    } else {
                                        user.setOp7("未公布");
                                    }
                                    editlist.add(user);
                                }
                            }

                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.素质.name())) {
                                List<DoSSUser> ssUsers = bsService.getSsUsers(ids, fid);
                                for (DoSSUser user : ssUsers) {
                                    if (user.getOp8() == null || user.getOp8().equals("未公布")) {
                                        user.setOp8("已公布");
                                    } else {
                                        user.setOp8("未公布");
                                    }
                                    editlist.add(user);
                                }
                            }

                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.笔试.name())) {
                                List<DoBSUser> bsUsers = bsService.getBsUsers(ids, fid);
                                for (DoBSUser user : bsUsers) {
                                    if (user.getOp6() == null || user.getOp6().equals("未公布")) {
                                        user.setOp6("已公布");
                                    } else {
                                        user.setOp6("未公布");
                                    }
                                    editlist.add(user);
                                }
                            }
                       /* if (nFlow.getFid() == EnumTools.FlowNomalState.岗位分配.ordinal()) {
                            for (DUserResume user : resumes) {
                                if (user.getOp6() == null || user.getOp6().equals("未公布"))
                                    user.setOp6("已公布");
                                else
                                    user.setOp6("未公布");
                                editlist.add(user);
                            }
                        }*/
                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.签约.name())) {
                                for (DUserResume user : resumes) {
                                    if (user.getOp9() == null || user.getOp9().equals("未公布")) {
                                        user.setOp9("已公布");
                                    } else {
                                        user.setOp9("未公布");
                                    }
                                    editlist.add(user);
                                }
                            }

                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.录用.name())) {
                                for (DUserResume user : resumes) {
                                    if (user.getOp5() == null || user.getOp5().equals("未公布")) {
                                        user.setOp5("已公布");
                                    } else {
                                        user.setOp5("未公布");
                                    }
                                    editlist.add(user);
                                }
                            }

                        } else {
                            if (nFlow.getFid() == EnumTools.FlowNomalState.简历筛选.ordinal()) {
                                for (DUserResume user : resumes) {
                                    if (user.getOp1() == null || user.getOp1().equals("未公布"))
                                        user.setOp1("已公布");
                                    else
                                        user.setOp1("未公布");
                                    editlist.add(user);
                                }
                            }
                            if (nFlow.getFid() == EnumTools.FlowNomalState.面试.ordinal()) {
                                List<DoMSUser> msUsers = msService.getMsUsers(ids, fid);
                                for (DoMSUser user : msUsers) {
                                    if (user.getOp7() == null || user.getOp7().equals("未公布"))
                                        user.setOp7("已公布");
                                    else
                                        user.setOp7("未公布");
                                    editlist.add(user);
                                }
                            }

                            if (nFlow.getFid() == EnumTools.FlowNomalState.背景调查.ordinal()) {
                                for (DUserResume user : resumes) {
                                    if (user.getOp3() == null || user.getOp3().equals("未公布"))
                                        user.setOp3("已公布");
                                    else
                                        user.setOp3("未公布");
                                    editlist.add(user);
                                }
                            }
                            if (nFlow.getFid() == EnumTools.FlowNomalState.体检.ordinal()) {
                                for (DUserResume user : resumes) {
                                    if (user.getOp4() == null || user.getOp4().equals("未公布"))
                                        user.setOp4("已公布");
                                    else
                                        user.setOp4("未公布");
                                    editlist.add(user);
                                }
                            }
                       /* if (nFlow.getFid() == EnumTools.FlowNomalState.岗位分配.ordinal()) {
                            for (DUserResume user : resumes) {
                                if (user.getOp6() == null || user.getOp6().equals("未公布"))
                                    user.setOp6("已公布");
                                else
                                    user.setOp6("未公布");
                                editlist.add(user);
                            }
                        }*/

                            if (nFlow.getFid() == EnumTools.FlowNomalState.录用.ordinal()) {
                                for (DUserResume user : resumes) {
                                    if (user.getOp5() == null || user.getOp5().equals("未公布"))
                                        user.setOp5("已公布");
                                    else
                                        user.setOp5("未公布");
                                    editlist.add(user);
                                }
                            }
                        }


                        if (editlist.size() > 0) {
                            utilService.editList(editlist);
                            utilService.printJsonResult(true, "操作成功！", "no", response);
                        } else {
                            utilService.printJsonResult(false, "当前选中的信息不能执行此操作！", "no", response);
                        }
                    } else {
                        utilService.printJsonResult(false, "当前流程不支持此操作！", "no", response);
                    }
                } else {
                    utilService.printJsonResult(false, "您无权执行此操作！", "no", response);
                }
            } else {
                utilService.printJsonResult(false, "请选择人员信息！", "no", response);
            }
        } catch (Exception e) {
            e.printStackTrace();
            utilService.printJsonResult(false, "操作失败！", "no", response);
        }
    }

    @RequestMapping(value = "/DUserResume/PublishArrangeAction", method = RequestMethod.POST)
    public void PublishArrangeAction(@RequestParam(value = "id") String[] id,
                                     @RequestParam(value = "deptcode", required = true) String deptcode,
                                     @RequestParam(value = "fid") String fid,
                                     HttpServletRequest request,
                                     HttpServletResponse response) {
        try {
            //id为空
            if (id == null) {
                utilService.printJsonResult(false, "请选择人员信息!", "no", response);
                return;
            }
            BaseUser user = utilService.getSessionUser(request);
            //似乎是部门?
            if (!user.getUdept().equals(deptcode)) {
                utilService.printJsonResult(false, "您无权执行此操作!", "no", response);
                return;
            }
            //流程是否结束
            if (!utilService.FlowIsDoing(fid)) {
                utilService.printJsonResult(false, "当前流程不支持此操作！", "no", response);
                return;
            }
            List editList = new ArrayList<>();
            List<DUserResume> resumes = doResumeService.getResumes(id);
            ProjectInfoFlow flow = projectService.getFolwById(fid);
            String flowName = flow.getFname();
            if (!StringTools.trimNotEmpty(flowName)) {
                flowName = flow.getNickname();
            }
            if(flow.getPid().indexOf("D_")>=0)
                arrangematchNZ(editList, resumes, flow, flowName);
            else
                arrangematch(editList, resumes, flow, flowName);

            if (editList.size() > 0) {
                utilService.editList(editList);
                utilService.printJsonResult(true, "操作成功！", "no", response);
            } else {
                utilService.printJsonResult(false, "当前选中的信息不能执行此操作！", "no", response);
            }
        } catch (Exception e) {
            e.printStackTrace();
            utilService.printJsonResult(false, "操作失败", "no", response);
        }
    }

    @SuppressWarnings("unchecked")
    private void arrangematch(List editList, List<DUserResume> resumes,
                              ProjectInfoFlow flow, String flowName) throws Exception {
        if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.资料审核.name())) {
            for (DUserResume usr : resumes) {
                if (usr.getZlarrange() == null || usr.getZlarrange().equals("未公布")) {
                    usr.setZlarrange("已公布");
                } else {
                    usr.setZlarrange("未公布");
                }
                editList.add(usr);
            }
        }

        if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.素质.name())) {
            for (DUserResume usr : resumes) {
                if (usr.getSsarrange() == null || usr.getSsarrange().equals("未公布")) {
                    usr.setSsarrange("已公布");
                } else {
                    usr.setSsarrange("未公布");
                }
                editList.add(usr);
            }
        }

        if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.笔试.name())) {
            for (DUserResume usr : resumes) {
                if (usr.getBsarrange() == null || usr.getBsarrange().equals("未公布")) {
                    usr.setBsarrange("已公布");
                } else {
                    usr.setBsarrange("未公布");
                }
                editList.add(usr);
            }
        }
        if (flow.getFid() == EnumTools.FlowNomalState.面试.ordinal()) {
            for (DUserResume usr : resumes) {
                if (usr.getMsarrange() == null || usr.getMsarrange().equals("未公布")) {
                    usr.setMsarrange("已公布");
                } else {
                    usr.setMsarrange("未公布");
                }
                editList.add(usr);
            }
        }
        if (flow.getFid() == EnumTools.FlowNomalState.体检.ordinal()) {
            for (DUserResume usr : resumes) {
                if (usr.getTjarrange() == null || usr.getTjarrange().equals("未公布")) {
                    usr.setTjarrange("已公布");
                } else {
                    usr.setTjarrange("未公布");
                }
                editList.add(usr);
            }
        }

        if (flow.getFid() == EnumTools.FlowNomalState.录用.ordinal()
                || EnumTools.FlowNomalState.录用.name().equalsIgnoreCase(flowName)) {
            for (DUserResume usr : resumes) {
                if (usr.getBdarrange() == null || usr.getBdarrange().equals("未公布")) {
                    usr.setBdarrange("已公布");
                } else {
                    usr.setBdarrange("未公布");
                }
                editList.add(usr);
            }
        }
    }
    @SuppressWarnings("unchecked")
    private void arrangematchNZ(List editList, List<DUserResume> resumes,
                              ProjectInfoFlow flow, String flowName) throws Exception {

        if (flowName.equalsIgnoreCase(EnumTools.NZFlowState.笔试.name())) {
            for (DUserResume usr : resumes) {
                if (usr.getBsarrange() == null || usr.getBsarrange().equals("未公布")) {
                    usr.setBsarrange("已公布");
                } else {
                    usr.setBsarrange("未公布");
                }
                editList.add(usr);
            }
        }
        if (flow.getFid() == EnumTools.NZFlowState.面试.ordinal()) {
            for (DUserResume usr : resumes) {
                if (usr.getMsarrange() == null || usr.getMsarrange().equals("未公布")) {
                    usr.setMsarrange("已公布");
                } else {
                    usr.setMsarrange("未公布");
                }
                editList.add(usr);
            }
        }

        if (flow.getFid() == EnumTools.NZFlowState.录用.ordinal()
                || EnumTools.FlowNomalState.录用.name().equalsIgnoreCase(flowName)) {
            for (DUserResume usr : resumes) {
                if (usr.getBdarrange() == null || usr.getBdarrange().equals("未公布")) {
                    usr.setBdarrange("已公布");
                } else {
                    usr.setBdarrange("未公布");
                }
                editList.add(usr);
            }
        }
    }

    @RequestMapping(value = "/DUserResume/PublishZZResultAction", method = RequestMethod.POST)
    public void PublishZZResultAction(HttpServletRequest request, HttpServletResponse response) {
        try {
            String[] ids = request.getParameterValues("id");//人员信息ID
            if (ids != null) {
                String fid = request.getParameter("fid").trim();//招聘流程ID
                String deptcode = request.getParameter("deptcode").trim();//责任部门编码
                BaseUser usr = utilService.getSessionUser(request);
                if (usr.getUdept().equals(deptcode)) {
                    //流程是否结束
                    if (utilService.FlowIsDoing(fid)) {
                        List editlist = new ArrayList();
                        ProjectInfoFlow nFlow = projectService.getFolwById(fid);
                        List<DUserResume> dUserResumeList = doResumeService.getResumes(nFlow.getPid());
                        List<HRZZUser> hrzzUserList = doZZService.getUsers(ids);
                        String flowName = nFlow.getFname();
                        if (!StringTools.trimNotEmpty(flowName)) {
                            flowName = nFlow.getNickname();
                        }
                        if (StringTools.trimNotEmpty(flowName)) {
                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.简历筛选.name())) {
                                for (HRZZUser hrzzUser : hrzzUserList) {
                                    if (hrzzUser.getOp1() == null || hrzzUser.getOp1().equals("未公布")) {
                                        hrzzUser.setOp1("已公布");
                                    } else {
                                        hrzzUser.setOp1("未公布");
                                    }
                                    editlist.add(hrzzUser);
                                    for (DUserResume user : dUserResumeList) {
                                        if (user.getUserid().equalsIgnoreCase(hrzzUser.getId())) {
                                            if (user.getOp1() == null || user.getOp1().equals("未公布")) {
                                                user.setOp1("已公布");
                                            } else {
                                                user.setOp1("未公布");
                                            }
                                            editlist.add(user);
                                        }
                                    }
                                }

                            }
                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.面试.name())) {
                                List<DoMSUser> msUsers = msService.getMsUsers(ids, fid);
                                for (DoMSUser user : msUsers) {
                                    if (user.getOp7() == null || user.getOp7().equals("未公布")) {
                                        user.setOp7("已公布");
                                    } else {
                                        user.setOp7("未公布");
                                    }
                                    editlist.add(user);
                                }
                                for (HRZZUser hrzzUser : hrzzUserList) {
                                    if (hrzzUser.getOp2() == null || hrzzUser.getOp2().equals("未公布")) {
                                        hrzzUser.setOp2("已公布");
                                    } else {
                                        hrzzUser.setOp2("未公布");
                                    }
                                    editlist.add(hrzzUser);
                                }
                            }

                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.背景调查.name()) || flowName.equalsIgnoreCase("政审")) {
                                for (HRZZUser hrzzUser : hrzzUserList) {
                                    if (hrzzUser.getOp4() == null || hrzzUser.getOp4().equals("未公布")) {
                                        hrzzUser.setOp4("已公布");
                                    } else {
                                        hrzzUser.setOp4("未公布");
                                    }
                                    editlist.add(hrzzUser);
                                    for (DUserResume user : dUserResumeList) {
                                        if (user.getUserid().equalsIgnoreCase(hrzzUser.getId())) {
                                            if (user.getOp3() == null || user.getOp3().equals("未公布")) {
                                                user.setOp3("已公布");
                                            } else {
                                                user.setOp3("未公布");
                                            }
                                            editlist.add(user);
                                        }
                                    }
                                }

                            }
                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.体检.name())) {
                                for (HRZZUser hrzzUser : hrzzUserList) {
                                    if (hrzzUser.getOp5() == null || hrzzUser.getOp5().equals("未公布")) {
                                        hrzzUser.setOp5("已公布");
                                    } else {
                                        hrzzUser.setOp5("未公布");
                                    }
                                    editlist.add(hrzzUser);
                                    for (DUserResume user : dUserResumeList) {
                                        if (user.getUserid().equalsIgnoreCase(hrzzUser.getId())) {
                                            if (user.getOp3() == null || user.getOp3().equals("未公布")) {
                                                user.setOp3("已公布");
                                            } else {
                                                user.setOp3("未公布");
                                            }
                                            editlist.add(user);
                                        }
                                    }
                                }

                            }

                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.资料审核.name())) {
                                for (HRZZUser hrzzUser : hrzzUserList) {
                                    if (hrzzUser.getOp3() == null || hrzzUser.getOp3().equals("未公布")) {
                                        hrzzUser.setOp3("已公布");
                                    } else {
                                        hrzzUser.setOp3("未公布");
                                    }
                                    editlist.add(hrzzUser);
                                    for (DUserResume user : dUserResumeList) {
                                        if (user.getUserid().equalsIgnoreCase(hrzzUser.getId())) {
                                            if (user.getOp2() == null || user.getOp2().equals("未公布")) {
                                                user.setOp2("已公布");
                                            } else {
                                                user.setOp2("未公布");
                                            }
                                            editlist.add(user);
                                        }
                                    }
                                }

                            }

                            if (nFlow.getFid() == EnumTools.FlowNomalState.实作.ordinal()) {
                                List<DoOperationUser> szUsers = szService.getSZUsers(fid, ids);
                                for (DoOperationUser user : szUsers) {
                                    if (user.getOp8() == null || user.getOp8().equals("未公布")) {
                                        user.setOp8("已公布");
                                    } else {
                                        user.setOp8("未公布");
                                    }
                                    editlist.add(user);
                                }
                            }

                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.实习.name())) {
                                for (HRZZUser hrzzUser : hrzzUserList) {
                                    if (hrzzUser.getOp7() == null || hrzzUser.getOp7().equals("未公布")) {
                                        hrzzUser.setOp7("已公布");
                                    } else {
                                        hrzzUser.setOp7("未公布");
                                    }
                                    editlist.add(hrzzUser);
                                    for (DUserResume user : dUserResumeList) {
                                        if (user.getUserid().equalsIgnoreCase(hrzzUser.getId())) {
                                            if (user.getOp7() == null || user.getOp7().equals("未公布")) {
                                                user.setOp7("已公布");
                                            } else {
                                                user.setOp7("未公布");
                                            }
                                            editlist.add(user);
                                        }
                                    }
                                }

                            }

                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.笔试.name())) {
                                List<DoBSUser> bsUsers = bsService.getBsUsers(ids, fid);
                                for (DoBSUser user : bsUsers) {
                                    if (user.getOp6() == null || user.getOp6().equals("未公布")) {
                                        user.setOp6("已公布");
                                    } else {
                                        user.setOp6("未公布");
                                    }
                                    editlist.add(user);
                                }
                            }
                       /* if (nFlow.getFid() == EnumTools.FlowNomalState.岗位分配.ordinal()) {
                            for (DUserResume user : resumes) {
                                if (user.getOp6() == null || user.getOp6().equals("未公布"))
                                    user.setOp6("已公布");
                                else
                                    user.setOp6("未公布");
                                editlist.add(user);
                            }
                        }*/
                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.签约.name())) {
                                for (HRZZUser hrzzUser : hrzzUserList) {
                                    if (hrzzUser.getOp9() == null || hrzzUser.getOp9().equals("未公布")) {
                                        hrzzUser.setOp9("已公布");
                                    } else {
                                        hrzzUser.setOp9("未公布");
                                    }
                                    editlist.add(hrzzUser);
                                    for (DUserResume user : dUserResumeList) {
                                        if (user.getUserid().equalsIgnoreCase(hrzzUser.getId())) {
                                            if (user.getOp9() == null || user.getOp9().equals("未公布")) {
                                                user.setOp9("已公布");
                                            } else {
                                                user.setOp9("未公布");
                                            }
                                            editlist.add(user);
                                        }
                                    }
                                }

                            }

                            if (flowName.equalsIgnoreCase(EnumTools.FlowNomalState.录用.name())) {
                                for (HRZZUser hrzzUser : hrzzUserList) {
                                    if (hrzzUser.getOp8() == null || hrzzUser.getOp8().equals("未公布")) {
                                        hrzzUser.setOp8("已公布");
                                    } else {
                                        hrzzUser.setOp8("未公布");
                                    }
                                    editlist.add(hrzzUser);
                                    for (DUserResume user : dUserResumeList) {
                                        if (user.getUserid().equalsIgnoreCase(hrzzUser.getId())) {
                                            if (user.getOp5() == null || user.getOp5().equals("未公布")) {
                                                user.setOp5("已公布");
                                            } else {
                                                user.setOp5("未公布");
                                            }
                                            editlist.add(user);
                                        }
                                    }
                                }

                            }

                        }


                        if (editlist.size() > 0) {
                            utilService.editList(editlist);
                            utilService.printJsonResult(true, "操作成功！", "no", response);
                        } else {
                            utilService.printJsonResult(false, "当前选中的信息不能执行此操作！", "no", response);
                        }
                    } else {
                        utilService.printJsonResult(false, "当前流程不支持此操作！", "no", response);
                    }
                } else {
                    utilService.printJsonResult(false, "您无权执行此操作！", "no", response);
                }
            } else {
                utilService.printJsonResult(false, "请选择人员信息！", "no", response);
            }
        } catch (Exception e) {
            e.printStackTrace();
            utilService.printJsonResult(false, "操作失败！", "no", response);
        }
    }
}
